home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2004 August / The Sunday Times - The Month 2004-08.iso / pc / engine / modules / lists.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2004-06-24  |  2.2 KB  |  79 lines

  1. function loadImage(mc, node, extrapath)
  2. {
  3.    var _loc3_ = extrapath;
  4.    if(_loc3_ == null)
  5.    {
  6.       _loc3_ = "";
  7.    }
  8.    var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
  9.    var _loc1_ = node.firstChild.nodeValue;
  10.    var _loc2_ = node.attributes.path;
  11.    if(_loc2_ != null)
  12.    {
  13.       _loc1_ = _loc2_ + _loc1_;
  14.    }
  15.    else
  16.    {
  17.       _loc1_ = strDefaultPath + _loc3_ + _loc1_;
  18.    }
  19.    if(strPathPrefix == null)
  20.    {
  21.       strPathPrefix = "";
  22.    }
  23.    mc.loadMovie(strPathPrefix + _loc1_);
  24. }
  25. function init()
  26. {
  27.    var _loc3_ = Tardis.ActiveSection.id;
  28.    var _loc1_ = Tardis.Colors;
  29.    strSECTION_COLOR = _loc1_.getString(_loc3_);
  30.    SECTION_COLOR = _loc1_.getHex(_loc3_);
  31.    SECTION_COLOR50 = _loc1_.getString(_loc3_ + "50");
  32.    DEFAULT_COLOR = _loc1_.getString("default");
  33.    hexDEFAULT_COLOR = _loc1_.getHex("default");
  34.    DEFAULT_COLOR50 = _loc1_.getString("default50");
  35.    ndItems = nodeData.byName("items");
  36.    ndListing = nodeData.byName("listing");
  37.    var _loc2_ = "<FONT COLOR=\"" + strSECTION_COLOR + "\">" + ndListing.byName("title").getText() + " </FONT>";
  38.    _loc2_ += "<FONT COLOR=\"" + SECTION_COLOR50 + "\"> " + ndListing.byName("title2").getText() + "</FONT>";
  39.    _loc2_ += "<FONT COLOR=\"" + DEFAULT_COLOR50 + "\"> " + ndListing.byName("title3").getText() + "</FONT>";
  40.    listingTitleFF.htmlText = _loc2_;
  41.    listingTitleFF.resize();
  42.    if(listingTitleFF._height > 40)
  43.    {
  44.       attachMovie("items2MC","itemMC",++depth);
  45.       itemMC._x = 8;
  46.       itemMC._y = 61;
  47.    }
  48.    else
  49.    {
  50.       attachMovie("items1MC","itemMC",++depth);
  51.       itemMC._x = 8;
  52.       itemMC._y = 38;
  53.    }
  54.    onComplete();
  55. }
  56. function exit()
  57. {
  58.    delete ndItems;
  59.    delete ndDefault;
  60.    delete nodeData;
  61. }
  62. function parseBoldTags(str)
  63. {
  64.    var _loc1_ = str;
  65.    var _loc2_ = _loc1_.indexOf("<b>");
  66.    if(_loc2_ != -1)
  67.    {
  68.       var _loc3_ = _loc1_.indexOf("</b>");
  69.       var word = _loc1_.substring(_loc2_ + 3,_loc3_);
  70.       var beginning = _loc1_.substring(0,_loc2_);
  71.       var end = _loc1_.substring(_loc3_ + 4);
  72.       return beginning + "<font face=\'FranklinGotURWTDem\'>" + word + "</font>" + parseBoldTags(end);
  73.    }
  74.    return _loc1_;
  75. }
  76. stop();
  77. onReady();
  78. depth = 0;
  79.